Field of the Invention
The invention relates to a memory management technology in an electronic apparatus.
Description of the Related Art
In various electronic apparatuses, more and more functions are achieved through software programs. To ensure normal operations of electronic products, manufacturers carry out test procedures before the products are shipped out of the factory, hoping to discover defects and hence debug the software programs in advance. For example, testing staff may intentionally perform an application program for an extended period of time to check whether the application program causes a memory leak issue that persistently and unreasonably occupies a memory space.
FIG. 1 shows a partial functional block diagram of a current electronic apparatus. When an operating module 11 of an application program that performs a certain task needs to use a memory 12, the operating module 11 issues a memory request to an application programming interface (API) 13. According to the size of a current available space of the memory 12, the API 13 determines whether the memory request is to be permitted. When the memory request is permitted, the API 13 correspondingly designates an available memory space to the operating module 11, and stores various information associated with this memory request into a database 14. The testing staff then determines whether the application program performed by the operating module 11 contains a defect associated with the memory 12 according to the information stored in the database 14.
In practice, there may be multiple application programs concurrently operating in the above electronic apparatus, and each of these application programs may concurrently perform multiple tasks. In current technologies, information associated with each memory request for accessing the memory 12 is loaded into the database 14. Thus, the amount of the information written into the database 14 is massive, and so the database 14 is required to have an extremely large capacity. Further, most current electronic apparatuses are designed to only allow the retrieval of data from the database for further analysis once an overall operation has ended. Such design with inadequate time validity prohibits the testing staff from real-time discovering defects in the application programs. In addition, bulky amounts of information accumulated over a period of time needs to be processed each time the analysis is performed.